package com.takanafu.haru.code{
	import com.takanafu.haru.core.GlobalManager;
	
	public class CodeDefaultValue extends CodeBase{
		private var symbol:CodeSymbol;
		private var code:CodeBase;
		
		public function CodeDefaultValue(symbol:CodeSymbol,c:CodeBase){
			this.symbol = symbol;
			this.code = c;
		}
		public function getName():CodeBase{
			return this.symbol;
		}
		public function getCode():CodeBase{
			return this.code;
		}
		override public function run():CodeBase{
			var val:CodeBase = null;
			
			if(this.code != null){
				val = this.code.run();
			}
			GlobalManager.def(this.symbol,val);
			return val;
		}
	}
}